INC=-I ../third
LIB=
OBJ=AgentProtocol.o AgentProtocolSub.o AgentManager.o framework.o ServerCase.o ServerTask.o ServerHttp.o ServerHttpStatic.o ServerHttpProxy.o ServerProtocol.o ServerSocksProxy.o ServerStress.o ServerHook.o SheepsFactory.o SheepsMain.o
TARGET=libframework.a

CC=gcc
CXX=g++ -std=c++11
DEFINE=-D_GNU_SOURCE -D_REENTRANT
CFLAGS=-g -O2 -pipe -Wall -fno-strict-aliasing -Wno-sizeof-pointer-memaccess -fPIC
CFLAGS+=$(DEFINE)
CFLAGS+=$(INC)
CFLAGS+=$(LIB)

all:
	make build OUT_CONFIG=-D_DEBUG

release:
	make build OUT_CONFIG=-DNDEBUG

build: $(TARGET)

$(TARGET):$(OBJ)
	ar rcs $(TARGET) $(OBJ)
%.o:%.cpp
	$(CXX) $(CFLAGS) $(OUT_CONFIG) -c $<
%.o:%.c
	$(CC) $(CFLAGS) $(OUT_CONFIG) -c $<

clean:
	rm -rf $(TARGET) *.o
